package edu.nyu.cyrus;

import java.util.Comparator;

public class CompareByGenderAsc implements Comparator<PersonDataModel>{

	public int compare(PersonDataModel o1, PersonDataModel o2) {
		if(o1.getGender().equals(o2.getGender())){
			return o1.getLname().compareTo(o2.getLname()) > 0 ? 1 : 0;
		}
		else{
			return o1.getGender().compareTo(o2.getGender()) > 0 ? 1 : 0;
		}
	}

}
